package site.oldpei.manage.erupt.entity;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.NoArgsConstructor;
import lombok.ToString;
import xyz.erupt.annotation.Erupt;
import xyz.erupt.annotation.EruptField;
import xyz.erupt.annotation.sub_field.Edit;
import xyz.erupt.annotation.sub_field.EditType;
import xyz.erupt.annotation.sub_field.View;
import xyz.erupt.annotation.sub_field.sub_edit.AttachmentType;
import xyz.erupt.jpa.model.BaseModel;

import javax.persistence.Entity;
import javax.persistence.Table;

@Entity
@Table(name = "p_actor_info")
@Erupt(name = "演员")
@ToString
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class ActorInfo extends BaseModel {

    //姓名
    @EruptField(
            views = @View(title = "姓名"),
            edit = @Edit(title = "姓名")
    )
    private String name;

    //头像
    @EruptField(
            views = @View(title = "头像"),
            edit = @Edit(title = "头像", type = EditType.ATTACHMENT,
                    attachmentType = @AttachmentType)
    )
    private String photo;
}
